package io.finer.erp.jeecg.purchase.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.finer.erp.jeecg.purchase.entity.PurchaseOrderLine;
import io.finer.erp.jeecg.purchase.entity.PurchaseRequestLine;
import io.finer.erp.jeecg.purchase.service.PurchaseOrderLineService;
import io.finer.erp.jeecg.purchase.service.PurchaseRequestLineService;
import io.finer.erp.jeecg.purchase.vo.PurchaseOrderLinePage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 采购订单行 前端控制器
 * </p>
 *
 * @author yaoyifan
 * @since 2021-06-15
 */
@Api(tags = "采购订单行")
@RestController
@RequestMapping("/purchase/purchaseOrderLine")
@Slf4j
public class PurchaseOrderLineController {

    @Autowired
    PurchaseOrderLineService purchaseOrderLineService;

    @AutoLog(value = "明细通过主表ID查询")
    @ApiOperation(value="明细主表ID查询", notes="明细-通主表ID查询")
    @GetMapping(value = "/queryLineByMainId")
    public Result<?> queryLineListByMainId(@RequestParam(name="id",required=true) String id) {
        List<PurchaseOrderLinePage> purchaseOrderLinePageList = purchaseOrderLineService.selectPurchaseOrderLinePageByMid(id);
        return Result.ok(purchaseOrderLinePageList);
    }
}

